package com.ehome.poct.core.service.mapping;

import com.ehome.paymentcenter.api.pay.BasePayReqCO;
import com.ehome.poct.core.api.constant.enums.OrderType;
import com.ehome.poct.core.api.dto.order.UnificationPayReqDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * @auther: kuiba.peng
 * @date: 2022/11/22 15:31
 * @description:
 */
@Mapper(componentModel = "spring", imports = {OrderType.class})
public interface TestOrderUnificationPayMapping {

    /**
     * 支付基础参数转换
     *
     * @param payReqDTO
     * @return
     */
    @Mapping(target = "orderNo", source = "payReqDTO.orderNo")
    @Mapping(target = "userId", source = "payReqDTO.userId")
    @Mapping(target = "title", source = "payReqDTO.showName")
    @Mapping(target = "desc", source = "payReqDTO.description")
    @Mapping(target = "payMoney", source = "payReqDTO.payMoney")
    @Mapping(target = "notifyUrl", source = "payReqDTO.payNotifyUrl")
    BasePayReqCO toBasePayReq(UnificationPayReqDTO payReqDTO);
}
